package activity;

import java.util.ArrayList;

import com.android.volley.VolleyError;
import com.qzhy.female.R;

import Constant.Constance;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;
import model.SignInfo;
import model.Sign_status;
import utils.GsonUtils;
import utils.HTTPUtils;
import utils.SetUtils;
import volley.VolleyListener;

public class MyMoneyActivity extends ActionBarActivity implements OnClickListener {

	private ImageView mImgBack;
//	private ArrayList<Sign> DataSign=new ArrayList<Sign>();
//	private ArrayList<User> DataUser=new ArrayList<User>();
	private TextView mTvMoney;
	private ArrayList<SignInfo> UserSign=new ArrayList<SignInfo>();

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_my_money);
		InitUI();
		InitDate();
	}


	private void InitDate() {
		HTTPUtils.get(getApplicationContext(), Constance.URL.USER+"/"+SetUtils.GetUserId(getApplicationContext()), new VolleyListener() {
			
			@Override
			public void onResponse(String arg0) {
				model.Sign_status Sign_status = GsonUtils.parseJSON(arg0, Sign_status.class);
				mTvMoney.setText(""+Sign_status.getResult().getScore());
			}
			@Override
			public void onErrorResponse(VolleyError arg0) {
			}
		});
	}

	private void InitUI() {
		mImgBack = (ImageView) findViewById(R.id.img_money_back);
		mImgBack.setOnClickListener(this);
		
		mTvMoney = (TextView) findViewById(R.id.tv_money);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.img_money_back:
			finish();
			break;
		default:
			break;
		}
	}
}
